home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / DEMO_VGA / PYRO.LZH / PYRO.DOC < prev    next >
Text File  |  1988-09-27  |  18KB  |  401 lines

  1.                     PYRO - A Simulated Pyrotechnics Display
  2.                     ---------------------------------------
  3.  
  4.                           Version 2.03  (August 1988)
  5.  
  6.                             (c) 1988  K.G. Shields
  7.                             (c) 1987  K.G. Shields
  8.  
  9.  
  10. PYRO Version 1.00 was a program designed to produce a realistic simulation of a
  11. Pyrotechnics (fireworks) display utilising the power of an IBM AT compatible
  12. and the colour graphics capability of an EGA display.  It was written as an
  13. entry in the 1987 "Your Computer" Microsoft Computer Program Art Competition,
  14. of which it was subsequently declared the winner.  ("Your Computer" is a
  15. computing magazine published in Australia.  The competition results were
  16. announced on page 34 of the January 1988 edition.)
  17.  
  18. The prize in the competition was an "Earth Computer System" with a 10 MHz,
  19. 0-wait state 80286 CPU with 2 Mbyte of memory, a 1.44 Mbyte floppy drive and a
  20. 40 Mbyte voice coil hard drive plus an NEC Multisync Monitor; an Epson LQ2500
  21. Colour Printer; and $2000 worth of Microsoft Software.  (At least that is what
  22. was advertised when the competition was announced.)
  23.  
  24. The current version of PYRO represents a major revision of the original
  25. program.  A number of features have been added, most of which were not possible
  26. in PYRO Version 1.00 because of the length limit of 199 lines imposed by the
  27. competition.
  28.  
  29. Additions include:
  30.  
  31. . An opening screen.
  32.  
  33. . A new effect - Catherine wheels.
  34.  
  35. . CGA, Hercules and text-only displays are supported.  The program now
  36.   identifies the type of display adapter in use.  VGA displays should be
  37.   detected correctly and driven in EGA mode, but this has not yet been tested.
  38.  
  39. . The program detects processor speed and adjusts delay loops to compensate. 
  40.   It also synchronizes itself with the timer tick of the machine.  Both these
  41.   actions are necessary to generate a smooth display and reasonable sound
  42.   effects.  The maximum number of points used may also be reduced
  43.   automatically, from a maximum of 60 down as far as about 24 if necessary.  If
  44.   the processor speed is too slow on an EGA-equipped machine, the program will
  45.   automatically switch to CGA mode.
  46.  
  47. . The program has been optimized considerably including trade-offs of size for
  48.   speed, and can now run on a much wider range of machines.  On very slow
  49.   machines it switches to a simplified script which limits the amount of
  50.   simultaneous screen activity that can occur.  While permitting a usable
  51.   presentation on slow machines, this very basic script gives only a taste of
  52.   what is possible when PYRO is run on a good fast processor.
  53.  
  54. . The source code is now compatible with Microsoft QuickC and Microsoft C 
  55.   Optimizing Compiler as well as Turbo C which was originally used.  I now use
  56.   QuickC as my development environment for C programming, and use the
  57.   Optimizing Compiler when development is complete.  For PYRO, QuickC generates
  58.   object code that is somewhat slower than that from Turbo C, however the
  59.   Microsoft C Optimizing Compiler generates code that is a few percent faster
  60.   than that from Turbo C.  (These results should not be taken as a general
  61.   indication of the relative performance of these compilers, as PYRO is not a
  62.   'typical' program.  See 'important note' below.)
  63.  
  64.  
  65. Requirements
  66. ------------
  67. . A fast IBM compatible such as a turbo XT or an AT
  68. . An EGA or CGA compatible display card, or Hercules monochrome.  VGA should
  69.   work in EGA mode (untested).
  70. . A colour display (preferably) if using EGA, CGA or VGA.
  71.  
  72. The configuration of choice is still an 8MHz or faster AT with an EGA card and
  73. a colour display.
  74.  
  75. When running at the correct speed one complete Pyrotechnics show, excluding the
  76. opening screen and end titles, will take about three to four minutes, or 180 to
  77. 240 seconds, to execute.  If it takes longer than this, your machine is not
  78. fast enough to run PYRO at the correct speed.  (The actual elapsed time and
  79. 'ideal' time in seconds are shown on the screen after PYRO terminates.)  If the
  80. EGA mode runs too slowly then try the CGA option, and similarly try the TEXT
  81. mode if CGA is too slow.
  82.  
  83.  
  84. Method of Use
  85. -------------
  86. Like a real fireworks display, PYRO is really meant to be viewed in the dark. 
  87. For the most realistic effect, first darken the room as much as possible and
  88. cover or turn off any LEDs or pilot lights on the computer and keyboard.  If
  89. darkening the room is too difficult PYRO will still give a convincing display
  90. by normal room lighting, but I recommend viewing it in the dark at least once
  91. to experience the full impact.
  92.  
  93. Put the PYRO disk in your A drive and make A: the default drive.  To execute
  94. PYRO to produce one complete Pyrotechnics presentation, enter
  95.  
  96.                pyro
  97.  
  98. at the DOS prompt.  Alternatively parameters may be specified which turn off
  99. sound effects, select the type of presentation (EGA, CGA or TEXT), or select
  100. continuous running.  For example the following command will produce a
  101. continuous show without sound effects, in CGA mode
  102.  
  103.                pyro c q cga
  104.  
  105. To terminate the show immediately at any time hit the escape key. For a more
  106. graceful exit press any other key and the program will stop after completing
  107. all currently active sequences.
  108.  
  109.  
  110. Parameters
  111. ----------
  112. C         Causes PYRO to run continuously until stopped by pressing a key.  Use
  113.           for a continuously running demo, or as a screen saver (but be warned:
  114.           visitors to your office may find it distracting).
  115.  
  116. Q         Runs in quiet mode, without explosion sound effects
  117.  
  118. EGA       Forces the program to run in EGA mode
  119.  
  120. CGA       Forces the program to run in CGA mode
  121.  
  122. HERC      Forces the program to run in Hercules mode
  123.  
  124. TEXT      Forces the program to run in TEXT mode.  This is experimental and is
  125.           only intended to be used on machines with no graphics capability or
  126.           which are too slow to run in graphics mode.  Produces severe 'snow'
  127.           on some video adapters.
  128.  
  129. R         Causes PYRO to report its assessment of display adapter type and
  130.           machine speed rating before starting the presentation.
  131.  
  132. F         Causes PYRO to execute at full speed, instead of attempting to
  133.           synchronise with the timer tick of the machine.  This option is used
  134.           only for checking the results of attempts to optimize the program.
  135.  
  136.  
  137. Test Results
  138. ------------
  139. PYRO has been tested on a number of machines of different speeds and with
  140. various different types of displays.  The results are summarised below.  These
  141. measurements were performed using the Turbo C version and the results when
  142. other compilers are used will vary slightly.
  143.  
  144.  
  145. Machine         Speed rating   Display mode  Time (secs)   Comments
  146.  
  147. NEC Powermate 1     337            EGA          204
  148. Cleveland AT        330            EGA          208
  149. Sperry              116            TEXT         179
  150. Olivetti M24        172            CGA          227
  151. Sharp PC7000        100            CGA          331        Slightly slow
  152. Cleveland XT         81            CGA          473        Slow
  153. Toshiba T1200       213            CGA          207
  154. NEC Powermate 386   474            EGA          183
  155. CCS XT (turbo)      173            CGA          254
  156. Earth 286 (10 MHz)  427            EGA          197
  157.  
  158.  
  159. IMPORTANT NOTE
  160. --------------
  161. Some people have tried to use PYRO as a benchmark test.  This is unsound as the
  162. program attempts to compensate for differences in speed between different
  163. machines.  I do not recommend the use of PYRO as a test for compiler speed,
  164. speed of generated object code, or machine speed.  The mix of instructions used
  165. in PYRO is probably very different from that of most other applications.
  166.  
  167.  
  168. Technical Details
  169. -----------------
  170. The program is written in the C programming language.  To achieve the required
  171. speed, the display registers and memory are accessed directly.  At the time
  172. PYRO was originally written, it was fairly difficult to find information about
  173. doing this.  However Microsoft Press have now published a book called
  174. "Programmer's Guide to PC & PS/2 Video Systems" by Richard Wilton, which I
  175. recommend to anyone wanting to use these techniques.
  176.  
  177. In general, PYRO works by generating points and allowing them to continue in
  178. motion under the effect of simulated gravity.  The attributes of a point
  179. include position, velocity, size, colour, lifetime, and rate of fade at the end
  180. of its life.  Most attributes are generated randomly for each point, but the
  181. various effects are achieved mainly by manipulating the limits within which
  182. each attribute may lie.
  183.  
  184. There are six different effects currently programmed:
  185.  
  186. Spurt            Produces intermittent eruptions of coloured sparks which fill
  187.                  the sky then fall gently to earth
  188.  
  189. Flare            A continuous stream of sparks emitted at high speed which fade
  190.                  quickly before they begin to fall
  191.  
  192. Burst            A starburst of brightly coloured points complete with sound
  193.                  effects
  194.  
  195. Rocket           A skyrocket which leaves behind a diffuse trail.  Most end in
  196.                  a starburst but for realism a percentage of 'fizzlers' simply
  197.                  fade away to nothing.
  198.  
  199. Roman Candle     A large fiery ball shoots skyward, leaving a short, quickly
  200.                  fading trail.  The ball explodes in a large burst that
  201.                  sometimes seems to fill the entire sky.
  202.  
  203. Catherine Wheel  A rotating catherine wheel emits streams of sparks in a spiral
  204.                  pattern.
  205.  
  206.  
  207. Files on the PYRO Disk
  208. ----------------------
  209. PYRO.C           The complete source code of the program written in Turbo C.
  210. PYRO.EXE         The program in executable form.
  211. PYRO.DOC         This file, the documentation of PYRO.
  212. PYRO1.C          The complete source code of PYRO 1.00, the original version.
  213. PYRO1.EXE        PYRO 1.00 in executable form.  Requires an AT with EGA
  214.                  graphics.
  215. PYRO1.DOC        The documentation of PYRO 1.00.
  216. PYROLAB.PCX      'Paintbrush' file to produce a colorful floppy disc label, if
  217.                  you have the means to print it.
  218. PYRO.MAK         'Make' file for use with QuickC.
  219. OPTPYRO.BAT      Batch file to compile PYRO with Optimizing C, using the
  220.                  options that result in the fastest object code.
  221.  
  222.  
  223. Future Plans
  224. ------------
  225. The initial version of PYRO was produced as an entry in the 'Your Computer'
  226. Microsoft Computer Program Art Exhibition.  The current version implements most
  227. of the 'wish list' items of the original.
  228.  
  229. Version 3.00 will be another major revision, the main new feature being that it
  230. will be programmable.  The language being planned is PyroScript, a PDL
  231. (Pyrotechnics Description Language).  This next version is probably a long way
  232. off, both because my ideas are fairly ambitious, and because I am now operating
  233. a full time computer consulting business which makes considerable demands on my
  234. time.
  235.  
  236.  
  237. Availability
  238. ------------
  239. PYRO 2.03 (along with all earlier versions) is in the public domain and may be
  240. copied and distributed freely.
  241.  
  242. Unless the written permission of the author is obtained beforehand, program
  243. PYRO may not be sold for any sum in excess of the normally accepted charges for
  244. copying and distributing public domain software, nor may it be used in any
  245. other manner for direct commercial gain.  However it may be used as a
  246. demonstration at trade shows, on dealers premises, etc, either alone or in
  247. combination with other programs.  The 'continuous' option is useful for this
  248. purpose.
  249.  
  250. Unless the written permission of the author is obtained beforehand, the whole
  251. or any part of PYRO may not be incorporated into any other item of computer
  252. software.
  253.  
  254.  
  255.  
  256. Please direct any comments, enquiries or suggestions to
  257.  
  258.                               Mr Kelvin G. Shields,
  259.                               Dimension 88,
  260.                               P.O. Box 202,
  261.                               Mount Ommaney,
  262.                               Queensland  4074,
  263.                               AUSTRALIA.
  264.  
  265.                               Phone:  (07) 376 8383
  266.  
  267.  
  268.  
  269.  
  270.  
  271.                                                        K.G. Shields.
  272.  
  273.                                                          08/08/88
  274.  
  275.  
  276.  
  277.  
  278. Footnote
  279. --------
  280. I am grateful for the encouraging comments I have received about PYRO, both
  281. from within Australia and from overseas, and I am keen to receive any further
  282. communications.
  283.  
  284. Thank you also to those who expressed concern about the trouble I have
  285. experienced in collecting my prizes from the competition, and asked to be kept
  286. informed of developments.  For you, and as a caution to others who may be
  287. interested in entering competitions, I include the summary below.  The full
  288. diary of events stretches for five pages, and a satisfactory conclusion has not
  289. yet been reached.  However both Microsoft and Epson were very cooperative when
  290. I eventually contacted them directly, and I do not believe any blame for my
  291. problems rests with them.
  292.  
  293. I am told it is not unusual for organisers and/or sponsers to lose interest in
  294. delivering prizes once a competition is completed, and this certainly seems to
  295. have happened here.  My colleagues tell me I have expended more effort in
  296. attempts to collect the prizes than I put into producing the original entry.
  297.  
  298.  
  299. Diary Summary
  300. -------------
  301.  
  302. 16/11/87  Received telegram from the magazine notifying me of my win.  Letters
  303.           and phone calls back and forth followed, and I was informed the prize
  304.           would be shipped without delay.  (Competition conditions specified
  305.           prizes would be delivered within 1 month of winners being notified.)
  306.  
  307. 08/01/88  After many phone calls which were not returned, I was told the prize
  308.           was already on its way and would arrive within a few days.
  309.  
  310. 01/02/88  After several more phone calls, demanded a report of current status. 
  311.           Was eventually told that the prize was shipped last week.  Suggested
  312.           I call back in a week's time if it had not arrived.
  313.  
  314. 11/02/88  After several more phone calls about non-arrival of prize, was told
  315.           to contact Epson (Sydney) as all parts of prize had been sent to them
  316.           for shipping.  Called Epson.  They were ready to send me the printer
  317.           but they knew nothing about the other components of the prize.
  318.  
  319. 25/02/88  Printer arrived from Epson.
  320.  
  321. 09/03/88  Was told by magazine that both software and computer had just arrived
  322.           in Australia and were both held up in Customs.  Suggested I call back
  323.           next Monday if not received by then.
  324.  
  325. 23/03/88  Spoke to local agents for the computer company and was given name and
  326.           phone number of a contact in Melbourne.  Called him and was told that
  327.           the machine offered as the prize had not yet been manufactured
  328.           because of delays overseas.  He was willing to give me a substitute
  329.           machine with equivalent specifications from their current product
  330.           line.  However he had not yet been informed by the magazine of the
  331.           outcome of the competition or the name of the winner, so would have
  332.           to contact them first.
  333.  
  334. 11/04/88  Spoke to local agents for Microsoft.  They promised to investigate
  335.           with Microsoft (Sydney) on my behalf.
  336.  
  337. 27/04/88  Microsoft called, recorded my list of selected software, and promised
  338.           to organize shipment as soon as posible.  Said they had not yet been
  339.           requested by the magazine to ship the prizes.  One of the other
  340.           prizewinners had had similar problems to my own and had also just
  341.           contacted Microsoft directly.
  342.  
  343. 28/04/88  Software arrived.
  344.  
  345. 02/05/88  Microsoft called to verify that shipment had arrived and was all in
  346.           order.
  347.  
  348. 27/05/88  After repeated calls to the computer company since first contact,
  349.           computer was finally shipped on this date.
  350.  
  351. 30/05/88  Computer arrived but is unsatisfactory in a number of ways:
  352.  
  353.           . The monitor is an EGA ECM-5400 made in Taiwan rather than the NEC
  354.             Multisync.  Furthermore the display adapter in the machine supports
  355.             enhanced modes I would like to use, but which cannot be used
  356.             without a multisync monitor.
  357.  
  358.           . An old-style keyboard was supplied rather than the 101 key type I
  359.             was assured would be provided.
  360.  
  361.           . Memory is only 640K.
  362.  
  363.           . Hard disk is only 20Mbyte.
  364.  
  365.           . The monitor power cable has a foreign (round pin) plug.
  366.  
  367.           . No printer cable.
  368.  
  369.           . MS-Dos and GW-Basic supplied on the hard disk but no floppy disks
  370.             supplied.  A Dos manual was supplied but no GW-Basic manual and no
  371.             User Manual for the machine.
  372.  
  373.           . A number of Norton programs supplied on the hard disk but no floppy
  374.             disks or manuals.  No indication whether I am legally entitled to
  375.             these.
  376.  
  377.           . No SETUP program supplied and it was needed because the CMOS
  378.             information was incorrect.
  379.  
  380.           . The machine fails to boot up when turned on, and has to be reset up
  381.             to a dozen or more times before it successfully boots.  During this
  382.             process keyboard and memory diagnostics may be produced.
  383.  
  384.           . The second serial port does not work.
  385.  
  386. 02/06/88  Sent a letter listing problems and asking for remedial action.
  387.  
  388. 16/06/88  No response yet, so phoned to verify that letter had been received.
  389.  
  390. 18/07/88  Sent second letter requesting action on previous letter.
  391.  
  392.  
  393. At this stage I have allowed a further two months for action, which I think is
  394. more than fair.  In that time I have received absolutely no communication from
  395. the computer company.  I now intend to enlist outside help to try to resolve
  396. the remaining problems.
  397.  
  398.  
  399.  
  400.                                                          27/09/88
  401.